package com.chaoxuan.uebt.utils;

import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;

import com.chaoxuan.uebt.App;
import com.chaoxuan.uebt.R;

/**
 * Created by Administrator on 2019/5/23.
 */
public class ToastUtils {
    /**
     * 一般的toast提示
     * @param textStr 提示信息
     */
    public static void showCustomToast(String textStr) {
        View layout = LayoutInflater.from(App.getInstance()).inflate(R.layout.layout_toast, null);
        TextView text = (TextView) layout.findViewById(R.id.toast_text_tv);
        View img = layout.findViewById(R.id.toast_msg_iv);
        text.setText(textStr);
        Toast toast = new Toast(App.getInstance());
        toast.setGravity(Gravity.CENTER, 0, 0);
        toast.setDuration(Toast.LENGTH_SHORT);
        toast.setView(layout);
        toast.show();
    }


}
